/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.clbs.ex.springgwt.server.extractor;

import com.clbs.ex.springgwt.client.model.Issue;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.ResultSetExtractor;

/**
 *
 * @author peerawat.poombua
 */
public class IssueExtractor implements ResultSetExtractor<Issue> {

    public Issue extractData(ResultSet rs) throws SQLException, DataAccessException {
        Issue issue = new Issue();
//        issue.setIssueID(rs.getInt(1));
//        issue.setName(rs.getString(2));
//        issue.setDescription(rs.getString(3));
//        issue.setIssue_statusID(rs.getInt(4));
        issue.setIssueID(rs.getInt("NISSUEID"));
        issue.setName(rs.getString("CNAME"));
        issue.setDescription(rs.getString("CDESCRIPTION"));
        issue.setIssue_statusID(rs.getInt("NISSUESTATUSID"));
        return issue;
    }

}
